import geopandas as gpd
import contextily as ctxLearning GeoPandas
Here is one way of getting the solution. There are others, feel free to share yours.
Download data.
price = gpd.read_file("https://martinfleischmann.net/sds/geographic_data/data/SED_CenovaMapa_p_shp.zip")
districts = gpd.read_file("https://martinfleischmann.net/sds/geographic_data/data/MAP_MESTSKECASTI_P_shp.zip")price["CENA"] = price["CENA"].replace("N", None).astype('float')- Plot the price.
- Plot boundaries on top. Try different colours to get a nice combination of colours.
- Show a legend.
- Use CartoDB Voyager or CartoDB Dark Matter basemap. Can you do that in a static plot as well?
- Can you figure out how to change the colormap?
- Can you change the transparency of polygons?
Interactive:
m = price.explore("CENA", legend=True, tiles="CartoDB Voyager", cmap="plasma", style_kwds={"fillOpacity": .5})
districts.boundary.explore(m=m, color="red")Make this Notebook Trusted to load map: File -> Trust Notebook